

<!-- Job heading to be displayed if only adding new JobVersion -->
<?php if( !$addNewJob && !$editJob): ?>
<div>
  <?php /*debug($job);*/ ?>
  <h2>Job: <?= $job['Job']['name']; ?></h2>
  
  <table cellpadding="0" cellspacing="0">
    <tr>
      <th>Group</th>
      <th>Alternate Job Name</th>
      <th>Description</th>
			<th>Directory Name</th>
			<th>Created</th>
    </tr>
    <tr>
      <td><?php echo $job['Job']['job_group'] ?>&nbsp;</td>
      <td><?php echo $job['JobAltName']['name'] ?>&nbsp;</td>
      <td><?php echo $job['Description']['content'] ?>&nbsp;</td>
      <td><?php echo $job['Job']['dir_name']; ?>&nbsp;</td>
      <td><?php echo $job['Job']['created']; ?>&nbsp;</td>
    </tr>
  </table>
</div>
<?php endif; ?>

<div class="jobs form">
  
<?php  // the 'url' param of create() lets me pass the state vars back to the conroller again 
echo $this->Form->create('Job', array('url' => array($job_id, 
                                                     $template_version_id, 
                                                     $edit_job_id, 
                                                     $edit_version_id) ));
?>
  <?php 
  //////////////////////////////////////////////////////////////////////
  /////////////// JOB Fields ///////////////////////////////////////////
  if($addNewJob || $editJob):
  ?>
  
	<fieldset id="jobFieldset">
		<legend> <?php echo $addNewJob ? 'Add Job' : 'Edit Job'; ?></legend>
    <?php
    // <editor-fold defaultstate="collapsed" desc="Id's for Job">
    if ($editJob) {
      echo $this->Form->input('id');
      echo $this->Form->input('JobAltName.id');
      echo $this->Form->input('Description.id');
    }// </editor-fold>

    // --------------------------------------------------------------
    // Selector widget for selecting Job Group and Job Name: 
    ?>
    <div id="jobGroupSelector">
      <?php 
      foreach ($jobGroups as $jobGroupName => $jobGroupArray) :        
        
        if(isset($this->data['Job']['job_group']) && $jobGroupName == $this->data['Job']['job_group']) {
          $panelId = 'open_panel'; $panelAnchorHref = '#open';
        }
        else {
          $panelId = '';  $panelAnchorHref = '#';
        }
      ?>
        <!-- the h3 and the div must be direct siblings for the Accordian to work (unless you set a diff header) -->
        <h3  id="<?=$panelId ?>">
          <a href="<?=$panelAnchorHref ?>"><?=$jobGroupName ?></a>
        </h3>

        <div>
          <?php 
          // I'm including some custom html attributes for each radio in this job group 
          // to hold data that applies to all jobs in this job group (I'm using jQuery to extract those vals)
          $radioGroupAttributes = array('legend' => false,
                                        'hiddenField'=>false,
                                        'class'=>'jobNameRadios',
                                        'data-jobGroup'=>$jobGroupName, // custom attribute
                                        'data-jobGroupFullPath'=>$jobGroupArray['groupAbsPath'] // custom attribute
                                       );
          $jobNamesKeyAndVal = array();
          foreach($jobGroupArray['jobDirs'] as $jobName) {
            $jobNamesKeyAndVal[$jobName] = $jobName;
          }
          echo $this->Form->radio('dir_name', $jobNamesKeyAndVal, $radioGroupAttributes);
          ?>
        </div>
      <?php
      endforeach;  
      ?>
    </div> <!-- end #jobGroupSelector div -->
    
    <?php
    //// ------------------------------------------------------------------------
    //// '.secondaryJobStuff' div (hide until a job group & dir has been selected
    ?>
    <div class="<?php echo($addNewJob && $validated ? 'secondaryJobStuff' : ''); ?>" >
    
    <?php 
            //echo $this->Form->input('job_group', array('type'=>'text'));
      // Job Group (one hidden and one disabled - val supplied by jQuery)
      echo $this->MyForm->dynamicInputsDisabledAndHidden('Job.job_group', 'JobJobGroupDiv', 'text');
      // Job Name
      echo $this->Form->input('name' /*, array('after'=>'<p class="guidance">Must be unique</p>')*/);
      // Job Alt Name
      echo $this->Form->input('JobAltName.name', array('label'=>'Alternate Job Name',
                                                       'div' => 'override_required'));
      // Job Dir Name
            //echo $this->Form->input('dir_name', array('label'=>'Job Directory Name'));
      echo $this->MyForm->dynamicInputsDisabledAndHidden('Job.dir_name', 'JobDirNameDiv', 'text');
      // Job Absolute Path
      $guidance = "<p class='guidance'>Include the job's dir, but not a trailing '/'. Example: /home/myJobDir</p>";
      $options = array('label'=>'Absolute path of Job Directory', 'after'=>$guidance);
            //echo $this->Form->input('dir_abs_path', $options);
            //echo $this->MyForm->inputsDisabledAndHidden('dir_abs_path', $options);
      echo $this->MyForm->dynamicInputsDisabledAndHidden('Job.dir_abs_path', 'JobDirAbsPathDiv',
                                                         'text',$options); 
      // Description
      echo $this->Form->input('Description.content', array('label'=>'Job Description',
                                                           'rows' =>'2',
                                                            // Add a CSS class to basically remove 'required' class:
                                                            'div' => 'override_required'));
      echo $form->input('Tag.name',array(
      //echo $form->input('JobsTag.Tag.name',array(
                          'type' => 'textarea',
                          'rows' => '1',
                          'label' => 'Tags',
                          'after' => '<span class="guidance">'
                                 .'Seperate each tag with a comma.  Eg: family, sports, icecream</span>',
                          'div' => 'override_required'));
    echo '</div>'; /// end '.secondaryJobStuff' div ///
    ?>
	</fieldset>
  
  <?php endif; // end if($addNewJob || $editJob) 
  //////////////////////////////////////////////////////////////////////////////
  /////////////// JOB VERSION Fields ///////////////////////////////////////////
  if($addNewJobVersion || $editJobVersion):
    $verNum = 0;
    $commentNum = 0;
  ?>
  
  <fieldset id="jobVersionFieldset" <?php echo (($addNewJob && $validated) ? 'class="secondaryJobStuff"' : ""); ?> >
    <legend> <?php echo $addNewJobVersion ? 'Add Job Version' : 'Edit Job Version'; ?></legend>

    <?php
      // <editor-fold defaultstate="collapsed" desc="Version Id's">
      // Job id's (so adding new version or editing version won't try to save a new Job)
      if( !$addNewJob) { // don't include id field if adding entire new job
        echo $this->Form->input('id');
      }
      if (isset($this->data['JobAltName']['id'])) {
        echo $this->Form->input('JobAltName.id');
      }
      if (isset($this->data['Description']['id'])) {
        echo $this->Form->input('Description.id');
      }
      // JobVersion id's 
      if ($editJobVersion) {
        echo $this->Form->input("JobVersion.$verNum.id");

        if (isset($this->data['JobVersionName']['id'])) {
          echo $this->Form->input("JobVersionName.id");
        }
        if (isset($this->data['JobVersionComment'][$commentNum]['id'])) {
          echo $this->Form->input("JobVersionComment.$commentNum.id");
        }
        if (isset($this->data['CudaJob']['id'])) {
          echo $this->Form->input("CudaJob.id");
        }
        if (isset($this->data['ParamFdkBasis']['id'])) {
          echo $this->Form->input("ParamFdkBasis.id");
        }
        if (isset($this->data['ParamSirtBasis']['id'])) {
          echo $this->Form->input("ParamSirtBasis.id");
        }
        if (isset($this->data['ParamImageRoiZ']['id'])) {
          echo $this->Form->input("ParamImageRoiZ.id");
        }
        if (isset($this->data['ParamImageIndir']['id'])) {
          echo $this->Form->input("ParamImageIndir.id");
        }
        if (isset($this->data['ParamImageOutdir']['id'])) {
          echo $this->Form->input("ParamImageOutdir.id");
        }
        if (isset($this->data['ParamProjGaussSigma']['id'])) {
          echo $this->Form->input("ParamProjGaussSigma.id");
        }
        if (isset($this->data['ParamProjOutdir']['id'])) {
          echo $this->Form->input("ParamProjOutdir.id");
        }
        if (isset($this->data['ParamMisclBwYmult']['id'])) {
          echo $this->Form->input("ParamMisclBwYmult.id");
        }
        if (isset($this->data['ParamMisclBwZmult']['id'])) {
          echo $this->Form->input("ParamMisclBwZmult.id");
        }
        if (isset($this->data['ParamMisclImgYpad']['id'])) {
          echo $this->Form->input("ParamMisclImgYpad.id");
        }     
        if (isset($this->data['ParamImageClip']['id'])) {
          echo $this->Form->input("ParamImageClip.id");
        }    
        if (isset($this->data['ParamImageZ']['id'])) {
          echo $this->Form->input("ParamImageZ.id");
        }  
      }// </editor-fold>

    // Version Name  
    $verNameOptions = array('label'=>'Version Name', 
                            'after'=>'<p class="guidance">Make this unique within this Job for best results</p>',
                            'div' => 'override_required');
    echo $this->Form->input("JobVersionName.name", $verNameOptions );
    // ------------------------------------
    // horizontal group to hold mult inputs 
    echo "<div class='horizGroup'>"; 
    // Version Number
    $verNumGuidance = '';
    $verNumOptions = array('label'=>'Version Number', 'after'=>$verNumGuidance, 'type' =>'text',
                           'div'=>'input text smallTextBoxDiv inline-block versionNum');
    echo $this->MyForm->inputsDisabledAndHidden("JobVersion.$verNum.version_num", $verNumOptions);
    // Status
    $statusOptions = array('type' =>'select', 'options'=>$statuses, 
                           'div'=>'input select smallTextBoxDiv inline-block'); 
    echo $this->MyForm->inputsDisabledAndHidden("JobVersion.$verNum.status_id", $statusOptions);
    echo "</div>";
    // end horizontal group     
    // --------------------
    // Author
    echo $this->Form->input("JobVersion.$verNum.author_id", 
                             array('after'=>'<p class="guidance">Go ahead, take credit!</p>'));
    // Comment
    $commentOptions = array('label'=>'Comment about this version','rows' =>'2','div' => 'override_required');
    echo $this->Form->input("JobVersionComment.$commentNum.comment", $commentOptions );
    // Job Type
    echo $this->MyForm->input("JobVersion.$verNum.job_type_id", 
                               array('empty'=>'Choose...')); //, // 'type' =>'radio',
                                                                 //'legend'=>'Job Type',
                                                                 //'options'=>$jobTypes));
            //    // Shows validation error for a field
            //    if($this->Form->isFieldError("JobVersion.job_type_id")) {
            //      echo $this->Form->error("JobVersion.job_type_id");
            //    }
    
      ///////////////////////////////////////////////////////////////////
      ////// IMAGE PARAMETERS ///////////////////////////////////////////
    ?>
      <fieldset id="paramFdkFieldset" class="paramFieldset <?php if($showFdk) echo "showFieldset"; ?>">
        <legend>FDK Parameters</legend>
      <?php
      //////// FDK //////////
      // Filter
      $fdkFilterOptions = array('label'=>'Filter', 'empty'=>'Choose...');
      echo $this->Form->input("ParamFdkBasis.param_fdk_filter_id", $fdkFilterOptions);
      // Alpha
      $guidance = '<p class="guidance">Float between 0 and 1 inclusive</p>';
      $fdkAlphaOptions = array('label'=>'Alpha', 'after'=>$guidance);
      echo $this->Form->input("ParamFdkBasis.alpha", $fdkAlphaOptions);
      ?>
    </fieldset> <!-- end paramsFdkFieldset --> 
    
    <fieldset id="paramSirtFieldset" class="paramFieldset <?php if($showSirt) echo "showFieldset"; ?>">
      <legend>SIRT Parameters</legend>
      <?php
      ////// PSIRT & SIRT (shared fieldset)  ////////
      
      // If this version is based on an existing version, set the SirtType in the Sirt Fieldset
      $sirtTypeOptions = array('div'=>'override_required');
      if($selectSirtType_Psirt) {
        $sirtTypeOptions['selected'] = '1'; // <option> value corresponding to Psirt
      }
      else {
        $sirtTypeOptions['selected'] = '2'; // <option> value corresponding to Sirt
      }
      //echo $this->Form->input('ParamSirtBasis.sirt_type_id', $sirtTypeOptions);
      echo $this->Form->hidden('ParamSirtBasis.sirt_type_id', $sirtTypeOptions); // hidden so not showing same info twice (but needed for data array)      
      // Alpha
      $guidance = '<p class="guidance">Float between 0 and 2 exclusive</p>';
      $options  = array('label'=>'Alpha', 'after'=>$guidance);
      echo $this->Form->input('ParamSirtBasis.alpha', $options);
      // Niter
      $guidance = '<p class="guidance">Integer 0 or greater</p>';
      $options  = array('label'=>'# Iterations', 'after'=>$guidance);
      echo $this->Form->input('ParamSirtBasis.niter', $options);
      // Nsubs
      $guidance = '<p class="guidance">Integer 1 or greater</p>';
      $options  = array('label'=>'# Subs', 'after'=>$guidance);
      echo $this->Form->input('ParamSirtBasis.nsubs', $options);
      echo $this->Form->input('ParamSirtBasis.sirt_subset_mode_x_id');
      echo $this->Form->input('ParamSirtBasis.sirt_subset_mode_y_id', array('options'=>$sirtSubsetModeYs));
      ?>
    </fieldset> <!-- end paramSirtFieldset -->
    
    <fieldset id="paramImageFieldset" class="paramFieldset showFieldset">
      <legend>Image Parameters</legend>
      <?php
      ////// IMAGE Params  ////////
      // -------------------------
      // Nx,Ny,Nz horizontal group 
      echo "<div class='horizGroup'>";
        $NxDivClasses = 'input text smallTextBoxDiv inline-block';
        $imageNxOptions = array('label'=>'Image Nx', 'after'=>'<p class="guidance">Unsigned Integer</p>',
                                'div'  =>$NxDivClasses);
        echo $this->Form->input("JobVersion.$verNum.param_image_nx", $imageNxOptions);
        $imageNyOptions = array('label'=>'Image Ny', 'after'=>'<p class="guidance">Unsigned Integer</p>',
                                'div'  =>$NxDivClasses);
        echo $this->Form->input("JobVersion.$verNum.param_image_ny", $imageNyOptions);
        $imageNzOptions = array('label'=>'Image Nz', 'after'=>'<p class="guidance">Unsigned Integer</p>',
                                'div'  =>$NxDivClasses);
        echo $this->Form->input("JobVersion.$verNum.param_image_nz", $imageNzOptions);
      echo "</div>";
      // end Nx,Ny,Nz horizontal group     
      // -----------------------------
      ?>
      <fieldset id="comproiFieldset">
        <legend>Comproi Settings</legend>
        <?php
        // ------------------------------
        // COMPROI PARAM horizontal group
        $comproiTextDivClasses = 'input text smallTextBoxDiv inline-block';
        echo "<div class='horizGroup'>"; 
        // Comproi type
        $comproiTypeOptions = array('label'=>'Comproi Type', 'div'=>$comproiTextDivClasses );
        echo $this->Form->input("JobVersion.$verNum.param_image_comproi_type_id", $comproiTypeOptions);
        // FOA Threshold
        $foaThresholdOptions = array('label'=>'FOA Threshold', 'div'=>$comproiTextDivClasses);
        echo $this->Form->input("JobVersion.$verNum.param_image_foa_threshold", $foaThresholdOptions);
        // FOA Outside Max
        $foaOutsidemaxOptions = array('label'=>'FOA OutsideMax', 'div'=>$comproiTextDivClasses);
        echo $this->Form->input("JobVersion.$verNum.param_image_foa_outsidemax", $foaOutsidemaxOptions);
        echo "</div>";
        // end Comproi param horizontal group     
        // ----------------------------------
        ?>
      </fieldset>
      <?php
      // Image type (U16, F32, FITS, PGM)
      $imageTypeOptions = array('label'=>'Image Type');
      echo $this->Form->input("JobVersion.$verNum.param_image_type_id", $imageTypeOptions);
      // --------------------------------
      // CLIP   group  
      echo "<div class='horizGroup'>"; 
        $CLIP_group_guidance = 'Note: If either Clip field is left blank, no Clip parameters will be saved!';
        echo   "<p class='guidance'>$CLIP_group_guidance</p>";
        $divClasses = 'input text smallTextBoxDiv inline-block override_required';
        $guidance = '<p class="guidance"></p>';
        // clipmin
        $options = array('label'=>'Clip min', 'after'=>$guidance, 'div'=>$divClasses);
        echo $this->Form->input("ParamImageClip.clipmin", $options);
        // clipmax
        $options = array('label'=>'Clip max', 'after'=>$guidance, 'div'=>$divClasses);
        echo $this->Form->input("ParamImageClip.clipmax", $options);
      echo "</div>";
      // end CLIP group     
      // -----------------------------
      // --------------------------------
      // VOXEL dxy, dz   horizontal group  
      echo "<div class='horizGroup'>"; 
        $dxyDivClasses = 'input text smallTextBoxDiv inline-block';
        $guidance = '<p class="guidance">Non-negative float</p>';
        // dxy
        $dxyOptions = array('label'=>'Voxel dxy', 'after'=>$guidance, 'div'=>$dxyDivClasses);
        echo $this->Form->input("JobVersion.$verNum.param_image_dxy", $dxyOptions);
        // dz
        $dzOptions = array('label'=>'Voxel dz', 'after'=>$guidance, 'div'=>$dxyDivClasses);
        echo $this->Form->input("JobVersion.$verNum.param_image_dz", $dzOptions);
      echo "</div>";
      // end Image dxy, dz (Voxel) horizontal group     
      // -----------------------------
      // ------------------------
      // ROI Z   horizontal group  
      echo "<div class='horizGroup'>";
        $ROI_group_guidance = 'Note: If either ROI Z field is left blank, no ROI Z parameters will be saved!';
        echo   "<p class='guidance'>$ROI_group_guidance</p>";
        // Roi Z 0
        $roizDivClasses = 'input text smallTextBoxDiv inline-block override_required';
        $guidance = '<p class="guidance">Integer 1 or greater</p>';
        $roiz0Options = array('label'=>'ROI Z 0', 'after'=>$guidance, 'div'=>$roizDivClasses);
        echo $this->Form->input("ParamImageRoiZ.roi_z_0", $roiz0Options);
        // Roi Z 1
        $guidance = '<p class="guidance">Integer</p>';
        $roiz1Options = array('label'=>'ROI Z 1', 'after'=>$guidance, 'div'=>$roizDivClasses);
        echo $this->Form->input("ParamImageRoiZ.roi_z_1", $roiz1Options);
      echo "</div>";
      // end ROI Z horizontal group     
      // --------------------------
      // Image Indir
      $divClasses = 'input text override_required';
      $options = array('label'=>'Image Input Directory', 'div'=>$divClasses);
      echo $this->Form->input("ParamImageIndir.indir", $options);
      // Image Outdir
      $options = array('label'=>'Image Output Directory','div'=>$divClasses);
      //echo $this->Form->input("ParamImageOutdir.outdir", $options);
      echo $this->MyForm->inputsDisabledAndHidden("ParamImageOutdir.outdir", $options);
      // ------------------------
      // IMG Z   group  
      echo "<div class='horizGroup'>";
        $group_guidance = 'Note: If either Image Z field is left blank, no Image Z parameters will be saved!';
        echo   "<p class='guidance'>$group_guidance</p>";
        // Img Z 0
        $divClasses = 'input text smallTextBoxDiv inline-block override_required';
        $guidance = '<p class="guidance">Integer</p>';
        $options = array('label'=>'Image Z 0', 'after'=>$guidance, 'div'=>$divClasses);
        echo $this->Form->input("ParamImageZ.out_z_0", $options);
        // Img Z 1
        $guidance = '<p class="guidance">Integer</p>';
        $options = array('label'=>'Image Z 1', 'after'=>$guidance, 'div'=>$divClasses);
        echo $this->Form->input("ParamImageZ.out_z_1", $options);
      echo "</div>";
      // end IMG Z group     
      // --------------------------
      ?>
    </fieldset> <!-- end paramImageFieldset -->

    <fieldset id="paramProjFieldset" class="paramFieldset showFieldset">
      <legend>Projection Parameters</legend>
      <?php
      ////////// PROJ Params  ////////
      // Proj Indir
      $options = array('label'=>'Projection Input Directory');
      echo $this->Form->input("JobVersion.$verNum.param_proj_indir", $options);
      // Proj Outdir
      $divClasses = 'input text override_required';
      $options = array('label'=>'Projection Output Directory', 'div'=>$divClasses);
      echo $this->Form->input("ParamProjOutdir.outdir", $options);
      // Step
      $guidance = "<p class='guidance'>Integer 1 or greater</p>";
      $divClasses = 'input text smallTextBoxDiv';
      $options = array('label'=>'Step', 'div'=>$divClasses, 'after'=>$guidance);
      echo $this->Form->input("JobVersion.$verNum.param_proj_step", $options);
      // Apply Medianfilter
      $divClasses = 'input checkbox override_required';
      $options = array('label'=>'Apply Median filter?', 'div'=>$divClasses);
      echo $this->Form->input("JobVersion.$verNum.param_proj_apply_medianfilter", $options);
      // Apply Gaussianfilter
      $divClasses = 'input checkbox override_required';
      $options = array('label'=>'Apply Gaussian filter?', 'div'=>$divClasses);
      echo $this->Form->input("JobVersion.$verNum.param_proj_apply_gaussianfilter", $options);
      // Gaussian Sigma
      echo "<div id='gaussianSigmaDiv' ";  if($applyGaussianFilter) echo "class='show'"; echo ">";
        $guidance = "<p class='guidance'>Req if applying Gaussian Filter</p>";
        $divClasses = 'input text smallTextBoxDiv';
        $options = array('label'=>'Gaussian Sigma', 'div'=>$divClasses, 'after'=>$guidance);
        echo $this->Form->input("ParamProjGaussSigma.gauss_sigma", $options);
      echo "</div>";
      // Apply Downsampling
      $divClasses = 'input checkbox override_required';
      $options = array('label'=>'Apply Downsampling?', 'div'=>$divClasses);
      echo $this->Form->input("JobVersion.$verNum.param_proj_apply_downsampling", $options);  
      ?>
    </fieldset> <!-- end paramProjFieldset -->  
    
    <fieldset id="paramMisclFieldset" class="paramFieldset showFieldset">
      <legend>Miscellaneous Parameters</legend>
      <?php
      ////////// MISCL Params  ////////
      // Reserror
      $divClasses = 'input checkbox override_required';
      $options = array('label'=>'Apply Reserror?', 'div'=>$divClasses);
      echo $this->Form->input("JobVersion.$verNum.param_miscl_reserror", $options);
      // ---------------
      // BW Mult & Image Y Pad  group
      echo "<div class='horizGroup'>";
        $guidance = "<p class='guidance'>Integer</p>";
        $divClasses = 'input text smallTextBoxDiv override_required inline-block';
        $options = array('label'=>'Image Y Pad', 'div'=>$divClasses, 'after'=>$guidance);
        echo $this->Form->input("ParamMisclImgYpad.img_ypad", $options);
        $options = array('label'=>'BW Y Mult', 'div'=>$divClasses, 'after'=>$guidance);
        echo $this->Form->input("ParamMisclBwYmult.bw_ymult", $options);
        $options = array('label'=>'BW Z Mult', 'div'=>$divClasses, 'after'=>$guidance);
        echo $this->Form->input("ParamMisclBwZmult.bw_zmult", $options);
      echo "</div>";
      // end BW Mult group
      // -----------------
      ?>
    </fieldset> <!-- end paramMisclFieldset -->  
    <?php
    // "Ready to Submit to Cuda"?
    $guidance = "<p class='guidance'>Unchecking will save the Job but not submit it to the cluster right now</p>";
        //$divClasses = 'input text smallTextBoxDiv override_required inline-block';
    $options = array('type'=>'checkbox', 'after'=>$guidance, 'checked'=>true, 
                     'name'=>'data[submitToCluster]', 'id'=>'submitToCluster');
    echo $this->Form->input("Ready to submit this job to the cluster?", $options);
    
          //    // "Email you when cluster job starts and ends"?
          //    echo "<div id='sendEmailDiv'>";
          //      $guidance = "<p class='guidance'>(Not yet implemented) Will be sent to: [author's email stored in db]</p>";
          //      $divClasses = 'input checkbox';
          //      $options = array('type'=>'checkbox', 'after'=>$guidance, 'checked'=>false, 
          //                       'name'=>'data[sendEmail]', 'id'=>'sendEmail');
          //      echo $this->Form->input("Email you when cluster job starts and ends?", $options);
          //    echo "</div>";
    
    // Cuda Wall Time
    echo "<div id='cudaWallTimeDiv'>";
      $guidance = "<p class='guidance'>Hours:Minutes:Seconds</p>";
      $divClasses = 'input';
      $options = array('type'=>'text', 'after'=>$guidance, 'value'=>"10:00:00", 
                       'name'=>'data[cudaWallTime]', 'id'=>'cudaWallTime');
      echo $this->Form->input("Cuda Wall Time", $options); 
    echo "</div>";
    ?>
  </fieldset> <!-- end jobVersionFieldset -->
  <?php ///////////////////////////////////////// 
  endif; // end if($addNewJobVersion || $editJobVersion) ///////////
  ?> 
  
  <!-- handling the entire SUBMIT BUTTON manually for finer control -->
  <div class="submit">
    <?php
    //////////////////////////////////////////
    // Configure SUBMIT BUTTON and its tooltip
    $disabledStr = '';
    if($addNewJob && $validated) $disabledStr = 'disabled="disabled"';
    $classStr = '';
    if($addNewJob && $validated) $classStr = 'class="disabledSubmit"';
    
    $submitButtonStr = "<input $disabledStr $classStr type='submit' value='Submit' />";
    $tooltipBody = "You must start by selecting the job group and job name. Then proceed to fill ".
                   "out the rest of the form in order to submit.";
    if($addNewJob && $validated) {
      // output the submit btn and all needed stuff for the tooltip
      echo $this->Tooltip->warning($submitButtonStr, $tooltipBody);
    }
    // If the job did not validate, the job group and job name will already be selected in the returned
    // form, so we don't need to tell the user that those must be selected, so no tooltip.
    else {
      echo $this->Form->end('Submit');
    }
    ?>
  </div> <!-- end .submit div -->
  
</div> <!-- end ".jobs form" div  -->


<!-- MENU -->
<!--
<div class="actions">
	<h3><?php __('Actions'); ?></h3>
	<ul>

		<li><?php echo $this->Html->link(__('List Jobs', true), array('action' => 'index'));?></li>
		<li><?php echo $this->Html->link(__('List Statuses', true), array('controller' => 'statuses', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Status', true), array('controller' => 'statuses', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Authors', true), array('controller' => 'authors', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Author', true), array('controller' => 'authors', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Job Types', true), array('controller' => 'job_types', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Job Type', true), array('controller' => 'job_types', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Descriptions', true), array('controller' => 'descriptions', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Description', true), array('controller' => 'descriptions', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Job Alt Names', true), array('controller' => 'job_alt_names', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Job Alt Name', true), array('controller' => 'job_alt_names', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Param Fdks', true), array('controller' => 'param_fdks', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Param Fdk', true), array('controller' => 'param_fdks', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Param Sirts', true), array('controller' => 'param_sirts', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Param Sirt', true), array('controller' => 'param_sirts', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Cuda Jobs', true), array('controller' => 'cuda_jobs', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Cuda Job', true), array('controller' => 'cuda_jobs', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Tags', true), array('controller' => 'tags', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Tag', true), array('controller' => 'tags', 'action' => 'add')); ?> </li>
	</ul>
</div>
-->